import axios from "axios";

// 封装获取文章列表的接口函数
export function getNews(params) {
    return axios({
        url: '/post',
        method: 'get',
        params,
        
    })
}
// 评论列表 传文章id
export function post_comment(id){
    return axios({
        url:'/post_comment/'+id,
       
    })
}
// 发表评论 /post_comment/:id
export function pulish(id,data){
    return axios({
        url:'/post_comment/'+id,
        method:'post',
        data
    })
}
// 点赞文章 /post_like/:id
export function postIike(id){
    return axios({
        url:'/post_like/'+id,
        method:'get',
    })
}
// 收藏文章 /post_star/:id
export function postCollect(id){
    return axios({
        url:'/post_star/'+id,
        method:'get',
    })
}
// 我的关注 /user_follows/
export function myFollow(){
    return axios({
        url:'/user_follows/',
        method:'get',
    })
}
// 我的收藏 user_star
export function myStar(){
    return axios({
        url:'/user_star/',
        method:'get'
    })
}
// 搜索文章/post_search 参数:keyword
export function mySearch(){
    return axios({
        url:'/post_search/',
        method:'get'
    })
}